Terminate allocated string.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 30 Sep 2003 04:51:37 +0000 (04:51 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 30 Sep 2003 04:51:37 +0000 (04:51 +0000)
gpsbabel/util.c

index 0bd965b8162128466beb8b32898722c939d7abab..5219a6606b922be616e643ea5c02d09d82c88623 100644 (file)
@@ -171,6 +171,7 @@ xstrndupt(const char *str, size_t sz)
 
        newstr = xmalloc(newlen + 1);
        memcpy(newstr, str, newlen);
+       newstr[newlen+1] = '\0';
        rtrim(newstr);
 
        return newstr;